package com.orange.cetback.controller.admin;


import com.orange.cetback.common.vo.PageResult;
import com.orange.cetback.common.vo.Result;
import com.orange.cetback.pojo.dto.WordDTO;
import com.orange.cetback.pojo.entity.Cet4Word;
import com.orange.cetback.service.Cet4WordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/admin-api/word")
@Tag(name = "单词接口")
public class WordController {
    @Autowired
    private Cet4WordService cet4WordService;

    @Operation(summary = "分页查询单词信息")
    @PostMapping("/page")
    public Result<PageResult<Cet4Word>> page(@RequestBody WordDTO wordDTO){
        log.info("分页查询单词信息：{}",wordDTO);
        PageResult<Cet4Word> pageResult = cet4WordService.pageQueryWord(wordDTO);
        return Result.success(pageResult);
    }
}
